3.9.82 \(\int (d \cot (e+f x))^n (a+b \tan (e+f x)) \, dx\) [882]

Optimal. Leaf size=96 \[ -\frac {b (d \cot (e+f x))^n \, _2F_1\left (1,\frac {n}{2};\frac {2+n}{2};-\cot ^2(e+f x)\right )}{f n}-\frac {a (d \cot (e+f x))^{1+n} \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\cot ^2(e+f x)\right )}{d f (1+n)} \]

[Out]

-b*(d*cot(f*x+e))^n*hypergeom([1, 1/2*n],[1+1/2*n],-cot(f*x+e)^2)/f/n-a*(d*cot(f*x+e))^(1+n)*hypergeom([1, 1/2
+1/2*n],[3/2+1/2*n],-cot(f*x+e)^2)/d/f/(1+n)

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 96, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3754, 3619, 3557, 371} \begin {gather*} -\frac {a (d \cot (e+f x))^{n+1} \, _2F_1\left (1,\frac {n+1}{2};\frac {n+3}{2};-\cot ^2(e+f x)\right )}{d f (n+1)}-\frac {b (d \cot (e+f x))^n \, _2F_1\left (1,\frac {n}{2};\frac {n+2}{2};-\cot ^2(e+f x)\right )}{f n} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d*Cot[e + f*x])^n*(a + b*Tan[e + f*x]),x]

[Out]

-((b*(d*Cot[e + f*x])^n*Hypergeometric2F1[1, n/2, (2 + n)/2, -Cot[e + f*x]^2])/(f*n)) - (a*(d*Cot[e + f*x])^(1
 + n)*Hypergeometric2F1[1, (1 + n)/2, (3 + n)/2, -Cot[e + f*x]^2])/(d*f*(1 + n))

Rule 371

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*((c*x)^(m + 1)/(c*(m + 1)))*Hyperg
eometric2F1[-p, (m + 1)/n, (m + 1)/n + 1, (-b)*(x^n/a)], x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rule 3557

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[b/d, Subst[Int[x^n/(b^2 + x^2), x], x, b*Tan[c + d
*x]], x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rule 3619

Int[((b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*T
an[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Tan[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x] && NeQ
[c^2 + d^2, 0] &&  !IntegerQ[2*m]

Rule 3754

Int[(cot[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_.))^(p_.), x_Symbol] :> Dist
[d^(n*p), Int[(d*Cot[e + f*x])^(m - n*p)*(b + a*Cot[e + f*x]^n)^p, x], x] /; FreeQ[{a, b, d, e, f, m, n, p}, x
] &&  !IntegerQ[m] && IntegersQ[n, p]

Rubi steps

\begin {align*} \int (d \cot (e+f x))^n (a+b \tan (e+f x)) \, dx &=d \int (d \cot (e+f x))^{-1+n} (b+a \cot (e+f x)) \, dx\\ &=a \int (d \cot (e+f x))^n \, dx+(b d) \int (d \cot (e+f x))^{-1+n} \, dx\\ &=-\frac {(a d) \text {Subst}\left (\int \frac {x^n}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{f}-\frac {\left (b d^2\right ) \text {Subst}\left (\int \frac {x^{-1+n}}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{f}\\ &=-\frac {b (d \cot (e+f x))^n \, _2F_1\left (1,\frac {n}{2};\frac {2+n}{2};-\cot ^2(e+f x)\right )}{f n}-\frac {a (d \cot (e+f x))^{1+n} \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\cot ^2(e+f x)\right )}{d f (1+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.22, size = 88, normalized size = 0.92 \begin {gather*} -\frac {(d \cot (e+f x))^n \left (b (1+n) \, _2F_1\left (1,\frac {n}{2};\frac {2+n}{2};-\cot ^2(e+f x)\right )+a n \cot (e+f x) \, _2F_1\left (1,\frac {1+n}{2};\frac {3+n}{2};-\cot ^2(e+f x)\right )\right )}{f n (1+n)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d*Cot[e + f*x])^n*(a + b*Tan[e + f*x]),x]

[Out]

-(((d*Cot[e + f*x])^n*(b*(1 + n)*Hypergeometric2F1[1, n/2, (2 + n)/2, -Cot[e + f*x]^2] + a*n*Cot[e + f*x]*Hype
rgeometric2F1[1, (1 + n)/2, (3 + n)/2, -Cot[e + f*x]^2]))/(f*n*(1 + n)))

________________________________________________________________________________________

Maple [F]
time = 0.31, size = 0, normalized size = 0.00 \[\int \left (d \cot \left (f x +e \right )\right )^{n} \left (a +b \tan \left (f x +e \right )\right )\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*cot(f*x+e))^n*(a+b*tan(f*x+e)),x)

[Out]

int((d*cot(f*x+e))^n*(a+b*tan(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))^n*(a+b*tan(f*x+e)),x, algorithm="maxima")

[Out]

integrate((b*tan(f*x + e) + a)*(d*cot(f*x + e))^n, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))^n*(a+b*tan(f*x+e)),x, algorithm="fricas")

[Out]

integral((b*tan(f*x + e) + a)*(d*cot(f*x + e))^n, x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (d \cot {\left (e + f x \right )}\right )^{n} \left (a + b \tan {\left (e + f x \right )}\right )\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))**n*(a+b*tan(f*x+e)),x)

[Out]

Integral((d*cot(e + f*x))**n*(a + b*tan(e + f*x)), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))^n*(a+b*tan(f*x+e)),x, algorithm="giac")

[Out]

integrate((b*tan(f*x + e) + a)*(d*cot(f*x + e))^n, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (d\,\mathrm {cot}\left (e+f\,x\right )\right )}^n\,\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*cot(e + f*x))^n*(a + b*tan(e + f*x)),x)

[Out]

int((d*cot(e + f*x))^n*(a + b*tan(e + f*x)), x)

________________________________________________________________________________________